package Q1;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
        }

        int[] dp = new int[n + 1]; //以 i 为结尾的 子数组，最长的能发音的子数组
        dp[1] = 1;

        for (int i = 2; i < n + 1; i++) {
            if (arr[i - 1] - arr[i - 2] >= 9) {
                dp[i] = 1;
            } else {
                dp[i] = dp[i - 1] + 1;
            }
        }

        int max = 0;
        for (int i = 0; i < n + 1; i++) {
            max = Math.max(max, dp[i]);
        }

        System.out.println(max);
    }
}
